import { request } from '@/plugins/request'

// 信息资料
export const getProfiles = username => {
    return request({
        method: 'GET',
        url: `/api/profiles/${username}`,
    })
}

// 获取公共文章列表
// export const getYourFeedArticles = username => {
//     return request({
//         method: 'GET',
//         url: '/api/articles/feed',
//         params,

//     })
// }

// 添加点赞
export const addFollow= username => {
    return request({
        method: 'POST',
        url: `/api/profiles/${username}/follow`
    })
}

// 取消点赞
export const deleteFollow = username => {
    return request({
        method: 'DELETE',
        url: `/api/profiles/${username}/follow`
    })
}

// 获取文章详情
export const getArticle = slug => {
    return request({
        method: 'GET',
        url: `/api/articles/${slug}`
    })
}

// 获取文章评论
export const getComments = slug => {
    return request({
        method: 'GET',
        url: `/api/articles/${slug}/comments`
    })
}
